import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { SysUser } from './entity/SysUser';
import { SysFile } from './entity/SysFile';
import { SysMenu } from './entity/SysMenu';
import { SysPermission } from './entity/SysPermission';
import { SysRole } from './entity/SysRole';
import { SysDepartment } from './entity/SysDepartment';
import { SysDict } from './entity/SysDict';
import { SysDictDetail } from './entity/SysDictDetail';
import { SysRoleUser } from './entity/SysRoleUser';
import { SysRolePermission } from './entity/SysRolePermission';
import { SysDepartmentRole } from './entity/SysDepartmentRole';
import { SysDepartmentUser } from './entity/SysDepartmentUser';
import { Oauth2RegisteredClient } from './entity/oauth2-registered-client';
import { Oauth2AuthorizationConsent } from './entity/oauth2-authorization-consent';
import { Oauth2Authorization } from './entity/oauth2-authorization';
import { SysLogger } from './entity/SysLogger';

@Module({
  imports: [
    TypeOrmModule.forRoot({
      type: 'mysql',
      host: 'localhost',
      port: 3306,
      username: 'system',
      password: '5201314A!',
      database: 'system',
      entities: [
        SysUser,
        SysLogger,
        SysFile,
        SysMenu,
        SysPermission,
        SysRole,
        SysDepartment,
        SysDict,
        SysDictDetail,
        SysRoleUser,
        SysRolePermission,
        SysDepartmentRole,
        SysDepartmentUser,
        // SysSetting,
        Oauth2Authorization,
        Oauth2RegisteredClient,
        Oauth2AuthorizationConsent
      ],

      synchronize: true
    })
  ]
})
export class AppModule {}
